﻿<Window x:Class="advadev.Windows.Graph.Demo.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:sys="clr-namespace:System;assembly=mscorlib"
        xmlns:advadevGraph="clr-namespace:advadev.Windows.Graph;assembly=advadev.Windows.Graph"
        Title="Line-Graph Demo" Height="640" Width="1024" Background="#CCCCCC">

    <Grid Background="#FFFFFF">
        <Grid.Resources>
            <Style TargetType="{x:Type Ellipse}">
                <Setter Property="Height" Value="20" />
                <Setter Property="Width" Value="20" />
                <Style.Triggers>
                    <Trigger Property="IsMouseOver" Value="True">
                        <Setter Property="Height" Value="30" />
                        <Setter Property="Width" Value="30" />
                    </Trigger>
                </Style.Triggers>
            </Style>
        </Grid.Resources>
        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <Border Grid.Row="0" Background="#FFFFFF" BorderBrush="#AAAAAA" BorderThickness="1" Margin="10">
            <advadevGraph:GraphContainer Margin="0" ClipToBounds="True">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="200" />
                        <ColumnDefinition Width="700" />
                        <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>
                    <Grid Grid.Column="1" Margin="0,0,50,0" HorizontalAlignment="Right" Visibility="Visible">
                        <Ellipse Fill="LightBlue" Stroke="Blue" StrokeThickness="1" Margin="-900,-200,0,0"
                                 advadevGraph:GraphContainer.GraphName="area1"
                                 advadevGraph:GraphContainer.GraphNodeIndex="0"
                                 advadevGraph:GraphContainer.LineDirection="HorizontalToHorizontal" />
                        <Ellipse Fill="LightGreen" Stroke="Green" StrokeThickness="1" Margin="-700,200,0,0"
                                 advadevGraph:GraphContainer.GraphName="area1"
                                 advadevGraph:GraphContainer.GraphNodeIndex="1"
                                 advadevGraph:GraphContainer.LineDirection="VerticalToHorizonal"
                                 advadevGraph:GraphContainer.HorizontalStartNodeAlignment="Center"
                                 advadevGraph:GraphContainer.VerticalStartNodeAlignment="Top" />
                        <Ellipse Fill="LightPink" Stroke="Pink" StrokeThickness="1" Margin="-500,-100,0,0"
                                 advadevGraph:GraphContainer.GraphName="area1"
                                 advadevGraph:GraphContainer.GraphNodeIndex="2"
                                 advadevGraph:GraphContainer.LineDirection="Direct" />
                        <Ellipse Fill="LightGray" Stroke="Gray" StrokeThickness="1" Margin="0,100,0,0"
                                 advadevGraph:GraphContainer.GraphName="area1"
                                 advadevGraph:GraphContainer.GraphNodeIndex="3"
                                 advadevGraph:GraphContainer.LineDirection="HorizontalToVertical"
                                 advadevGraph:GraphContainer.HorizontalStartNodeAlignment="Center"
                                 advadevGraph:GraphContainer.VerticalStartNodeAlignment="Center"
                                 advadevGraph:GraphContainer.HorizontalEndNodeAlignment="Center"
                                 advadevGraph:GraphContainer.VerticalEndNodeAlignment="Center" />
                        <Ellipse Fill="LightYellow" Stroke="Yellow" StrokeThickness="1" Margin="200,0,0,0"
                                 advadevGraph:GraphContainer.GraphName="area1"
                                 advadevGraph:GraphContainer.GraphNodeIndex="4"
                                 advadevGraph:GraphContainer.LineDirection="VerticalToVertical"
                                 advadevGraph:GraphContainer.LineOffset="10"
                                 advadevGraph:GraphContainer.HorizontalEndNodeAlignment="Center"
                                 advadevGraph:GraphContainer.VerticalEndNodeAlignment="Bottom"
                                 advadevGraph:GraphContainer.HorizontalStartNodeAlignment="Center"
                                 advadevGraph:GraphContainer.VerticalStartNodeAlignment="Top" />
                        <Ellipse Fill="LightBlue" Stroke="Blue" StrokeThickness="1" Margin="150,-150,0,0"
                                 advadevGraph:GraphContainer.GraphName="area1"
                                 advadevGraph:GraphContainer.GraphNodeIndex="5"
                                 advadevGraph:GraphContainer.HorizontalEndNodeAlignment="Center"
                                 advadevGraph:GraphContainer.VerticalEndNodeAlignment="Bottom" />
                        <Ellipse Fill="LightBlue" Stroke="Blue" StrokeThickness="1" Margin="250,-150,0,0"
                                 advadevGraph:GraphContainer.GraphName="area1"
                                 advadevGraph:GraphContainer.GraphNodeIndex="5"
                                 advadevGraph:GraphContainer.HorizontalEndNodeAlignment="Center"
                                 advadevGraph:GraphContainer.VerticalEndNodeAlignment="Bottom" />
                        <Rectangle Fill="Green" Height="25" Width="50" Margin="-225,125,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" />
                        <Ellipse StrokeThickness="0" Height="100" Width="100" Margin="-200,0,0,0"
                                 advadevGraph:GraphContainer.IsLayerWithComplexGeometry="False"
                                 advadevGraph:GraphContainer.LayerIndex="1">
                            <Ellipse.Resources>
                                <Style TargetType="{x:Type Ellipse}">
                                    <Setter Property="Fill" Value="#0000ff" />
                                    <Setter Property="Height" Value="100" />
                                    <Setter Property="Width" Value="100" />
                                    <Style.Triggers>
                                        <Trigger Property="IsMouseOver" Value="True">
                                            <Setter Property="Fill" Value="YellowGreen" />
                                        </Trigger>
                                    </Style.Triggers>
                                </Style>
                            </Ellipse.Resources>
                            <Ellipse.Clip>
                                <CombinedGeometry GeometryCombineMode="Exclude">
                                    <CombinedGeometry.Geometry1>
                                        <EllipseGeometry Center="50,50" RadiusX="50" RadiusY="50" />
                                    </CombinedGeometry.Geometry1>
                                    <CombinedGeometry.Geometry2>
                                        <EllipseGeometry Center="50,50" RadiusX="25" RadiusY="25" />
                                    </CombinedGeometry.Geometry2>
                                </CombinedGeometry>
                            </Ellipse.Clip>
                        </Ellipse>
                    </Grid>
                    <Grid Grid.Column="0" Background="#CCCCCC">
                        <Grid Margin="10">
                            <TextBlock Text="Line-Graph with misc. node elements. The green rectangle is not marked as layer element - so the lines will be above it. The blue ellipse is marked as not complex layer element - so the lines will be clipped by its outer rectangle" TextWrapping="Wrap" />
                        </Grid>
                    </Grid>
                </Grid>
            </advadevGraph:GraphContainer>
        </Border>
        <Border Grid.Row="1" Background="#FFFFFF" BorderBrush="#AAAAAA" BorderThickness="1" Margin="10">
            <advadevGraph:GraphContainer Margin="0" ClipToBounds="True">
                <Grid Background="LightBlue">
                    <Grid.Resources>
                        <Style TargetType="{x:Type advadevGraph:GraphSegment}">
                            <Setter Property="Stroke">
                                <Setter.Value>
                                    <LinearGradientBrush>
                                        <LinearGradientBrush.GradientStops>
                                            <GradientStop Color="#000000" Offset="0" />
                                            <GradientStop Color="#000000" Offset="0.5" />
                                            <GradientStop Color="#000000" Offset="1" />
                                        </LinearGradientBrush.GradientStops>
                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>
                            <Setter Property="SnapsToDevicePixels" Value="True" />
                            <Setter Property="StrokeThickness" Value="1" />
                            <Setter Property="FilterColor" Value="#ffffff" />
                            <Setter Property="RenderOptions.EdgeMode" Value="Unspecified" />
                            <Style.Triggers>
                                <Trigger Property="IsMouseOver" Value="True">
                                    <Setter Property="StrokeThickness" Value="5" />
                                </Trigger>
                            </Style.Triggers>
                        </Style>
                    </Grid.Resources>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="200" />
                        <ColumnDefinition Width="700" />
                        <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>
                    <Grid Grid.Column="1" Margin="0,0,50,0" HorizontalAlignment="Right">
                        <Ellipse Fill="LightBlue" Stroke="Blue" StrokeThickness="1" Margin="-900,-200,0,0"
                                 advadevGraph:GraphContainer.GraphName="area2"
                                 advadevGraph:GraphContainer.GraphNodeIndex="0"
                                 advadevGraph:GraphContainer.LineDirection="HorizontalToHorizontal" />
                        <Ellipse Fill="LightGreen" Stroke="Green" StrokeThickness="1" Margin="-700,200,0,0"
                                 advadevGraph:GraphContainer.GraphName="area2"
                                 advadevGraph:GraphContainer.GraphNodeIndex="1"
                                 advadevGraph:GraphContainer.LineDirection="VerticalToHorizonal"
                                 advadevGraph:GraphContainer.HorizontalStartNodeAlignment="Center"
                                 advadevGraph:GraphContainer.VerticalStartNodeAlignment="Top" />
                        <Ellipse Fill="LightPink" Stroke="Pink" StrokeThickness="1" Margin="-500,-100,0,0"
                                 advadevGraph:GraphContainer.GraphName="area2"
                                 advadevGraph:GraphContainer.GraphNodeIndex="2"
                                 advadevGraph:GraphContainer.LineDirection="Direct" />
                        <Ellipse Fill="LightGray" Stroke="Gray" StrokeThickness="1" Margin="0,100,0,0"
                                 advadevGraph:GraphContainer.GraphName="area2"
                                 advadevGraph:GraphContainer.GraphNodeIndex="3"
                                 advadevGraph:GraphContainer.LineDirection="HorizontalToVertical"
                                 advadevGraph:GraphContainer.HorizontalStartNodeAlignment="Center"
                                 advadevGraph:GraphContainer.VerticalStartNodeAlignment="Center"
                                 advadevGraph:GraphContainer.HorizontalEndNodeAlignment="Center"
                                 advadevGraph:GraphContainer.VerticalEndNodeAlignment="Center" />
                        <Ellipse Fill="LightYellow" Stroke="Yellow" StrokeThickness="1" Margin="200,0,0,0"
                                 advadevGraph:GraphContainer.GraphName="area2"
                                 advadevGraph:GraphContainer.GraphNodeIndex="4"
                                 advadevGraph:GraphContainer.LineDirection="VerticalToVertical"
                                 advadevGraph:GraphContainer.LineOffset="10"
                                 advadevGraph:GraphContainer.HorizontalEndNodeAlignment="Center"
                                 advadevGraph:GraphContainer.VerticalEndNodeAlignment="Bottom"
                                 advadevGraph:GraphContainer.HorizontalStartNodeAlignment="Center"
                                 advadevGraph:GraphContainer.VerticalStartNodeAlignment="Top" />
                        <Ellipse Fill="LightBlue" Stroke="Blue" StrokeThickness="1" Margin="150,-150,0,0"
                                 advadevGraph:GraphContainer.GraphName="area2"
                                 advadevGraph:GraphContainer.GraphNodeIndex="5"
                                 advadevGraph:GraphContainer.HorizontalEndNodeAlignment="Center"
                                 advadevGraph:GraphContainer.VerticalEndNodeAlignment="Bottom" />
                        <Ellipse Fill="LightBlue" Stroke="Blue" StrokeThickness="1" Margin="250,-150,0,0"
                                 advadevGraph:GraphContainer.GraphName="area2"
                                 advadevGraph:GraphContainer.GraphNodeIndex="5"
                                 advadevGraph:GraphContainer.HorizontalEndNodeAlignment="Center"
                                 advadevGraph:GraphContainer.VerticalEndNodeAlignment="Bottom" />
                        <Rectangle Fill="Green" Height="25" Width="50" Margin="-225,125,0,0" HorizontalAlignment="Left" VerticalAlignment="Top"
                                   advadevGraph:GraphContainer.IsLayerWithComplexGeometry="False"
                                   advadevGraph:GraphContainer.LayerIndex="1" />
                        <Ellipse Name="clipEllipse" StrokeThickness="0" Margin="-200,0,0,0" RenderTransformOrigin="0.5,0.5"
                                 advadevGraph:GraphContainer.IsLayerWithComplexGeometry="True"
                                 advadevGraph:GraphContainer.LayerIndex="1">
                            <Ellipse.Resources>
                                <Style TargetType="{x:Type Ellipse}">
                                    <Setter Property="Fill" Value="#0000ff" />
                                    <Setter Property="Height" Value="100" />
                                    <Setter Property="Width" Value="100" />
                                    <Style.Triggers>
                                        <Trigger Property="IsMouseOver" Value="True">
                                            <Setter Property="Fill" Value="YellowGreen" />
                                        </Trigger>
                                    </Style.Triggers>
                                </Style>
                            </Ellipse.Resources>
                            <Ellipse.Clip>
                                <CombinedGeometry GeometryCombineMode="Exclude">
                                    <CombinedGeometry.Geometry1>
                                        <EllipseGeometry Center="50,50" RadiusX="150" RadiusY="150" />
                                    </CombinedGeometry.Geometry1>
                                    <CombinedGeometry.Geometry2>
                                        <EllipseGeometry Center="50,50" RadiusX="25" RadiusY="25" />
                                    </CombinedGeometry.Geometry2>
                                </CombinedGeometry>
                            </Ellipse.Clip>
                        </Ellipse>
                    </Grid>
                    <Grid Grid.Column="0" Background="#CCCCCC">
                        <Grid Margin="10">
                            <TextBlock Text="Line-Graph with misc. node elements. The green rectangle is marked as layer element - so the lines will be below it. The blue ellipse is marked as complex layer element - so the lines will be clipped by its visual appearance" TextWrapping="Wrap" />
                        </Grid>
                    </Grid>
                </Grid>
            </advadevGraph:GraphContainer>
        </Border>
    </Grid>

</Window>
